package org.jetnuke.common;

import net.jforum.security.PermissionControl;



public class AdminInfo implements IAdminInfo {
	PermissionControl pc;
	boolean isAuthor;
	public boolean isAuthor(){
		return isAuthor;
	}
	
	/**
	 * @param pc
	 */
	public AdminInfo(PermissionControl pc) {
		
		this.pc=pc;
		isAuthor=isAdminArticle()||isAdminTopic()||isAdminUser()||isAdminSurvey()||isAdminLink()||
		isAdminEphem()||isAdminFaq()|| isAdminDownload()||isAdminReviews()||isAdminNewsLetter()||
		isAdminContent()||isAdminEncy()|| IsSuperUser()||isAdminSection();
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see org.jetnuke.common.IAdminInfo#isAdminArticle()
	 */
	public boolean isAdminArticle() {

		return pc.canAccess(SecurityConstants.AdminArticle);
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see org.jetnuke.common.IAdminInfo#isAdminTopic()
	 */
	public boolean isAdminTopic() {

		return pc.canAccess(SecurityConstants.AdminTopic);
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see org.jetnuke.common.IAdminInfo#isAdminUser()
	 */
	public boolean isAdminUser() {

		return pc.canAccess(SecurityConstants.AdminUser);
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see org.jetnuke.common.IAdminInfo#isAdminSurvey()
	 */
	public boolean isAdminSurvey() {

		return pc.canAccess(SecurityConstants.AdminSurvey);
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see org.jetnuke.common.IAdminInfo#isAdminLink()
	 */
	public boolean isAdminLink() {

		return pc.canAccess(SecurityConstants.AdminLink);
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see org.jetnuke.common.IAdminInfo#isAdminEphem()
	 */
	public boolean isAdminEphem() {

		return pc.canAccess(SecurityConstants.AdminEphem);
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see org.jetnuke.common.IAdminInfo#isAdminFaq()
	 */
	public boolean isAdminFaq() {

		return pc.canAccess(SecurityConstants.AdminFaq);
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see org.jetnuke.common.IAdminInfo#isAdminDownload()
	 */
	public boolean isAdminDownload() {

		return pc.canAccess(SecurityConstants.AdminDownload);
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see org.jetnuke.common.IAdminInfo#isAdminReviews()
	 */
	public boolean isAdminReviews() {

		return pc.canAccess(SecurityConstants.AdminReviews);
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see org.jetnuke.common.IAdminInfo#isAdminNewsLetter()
	 */
	public boolean isAdminNewsLetter() {

		return pc.canAccess(SecurityConstants.AdminNewsLetter);
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see org.jetnuke.common.IAdminInfo#isAdminForum()
	 */
	/*public boolean isAdminForum() {

		return au.getRADMINFORUM() == 1;
	}*/

	/*
	 * (non-Javadoc)
	 * 
	 * @see org.jetnuke.common.IAdminInfo#isAdminContent()
	 */
	public boolean isAdminContent() {

		return pc.canAccess(SecurityConstants.AdminContent);
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see org.jetnuke.common.IAdminInfo#isAdminEncy()
	 */
	public boolean isAdminEncy() {

		return pc.canAccess(SecurityConstants.AdminEncy);
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see org.jetnuke.common.IAdminInfo#IsSuperUser()
	 */
	public boolean IsSuperUser() {

		return pc.canAccess(net.jforum.security.SecurityConstants.PERM_ADMINISTRATION);
	}


	/*
	 * (non-Javadoc)
	 * 
	 * @see org.jetnuke.common.IAdminInfo#isAdminSection()
	 */
	public boolean isAdminSection() {

		return pc.canAccess(SecurityConstants.AdminSection);
	}

}
